package gitprueba;

public class punto2D {
    public punto2D(){}
    private float x;
    private float y;

    public void setX(float x) {
        this.x = x;
    }

    public float getX() {
        return x;
    }

    public void setY(float y) {
        this.y = y;
    }

    public float getY() {
        return y;
    }

    @Override
    public boolean equals(Object object) {
        if (this == object) {
            return true;
        }
        if (!(object instanceof punto2D)) {
            return false;
        }
        final punto2D other = (punto2D) object;
        if (Float.compare(x, other.x) != 0) {
            return false;
        }
        if (Float.compare(y, other.y) != 0) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        final int PRIME = 37;
        int result = 1;
        result = PRIME * result + Float.floatToIntBits(x);
        result = PRIME * result + Float.floatToIntBits(y);
        return result;
    }
    
    public void moverX (float offsetX){ 
     x += offsetX; 
     } 
     public void moverY (float offsetY){ 
     y += offsetY; 
     } 

}
